<?
$filename = "mycounter.txt";
//open the file
$fileToOpen = fopen($filename,"w");
//set the content of the file into a variable
$content = fread($fileToOpen, filesize($filename));

//check if the textfile is empty
if($content == "")
{
 $content = 0;
}

//increment the file
$content++;
//store the file
fputs($content);
//close the file
fclose($fileToOpen);

//display the hits
echo($content);
?>

